package com.example.test_20210630;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;

public class IOTest {

    public static void main(String[] args) throws Exception {
        File file = new File("src/main/java/com/example/test_20210630/123.txt");
//        FileOutputStream fileOutputStream = new FileOutputStream(file,true);
//        String mes = "\n1111建党100周年";
//        byte[] bytes = mes.getBytes(StandardCharsets.UTF_8);
//        fileOutputStream.write(bytes,0,bytes.length);
//        fileOutputStream.close();

        FileInputStream inputStream = new FileInputStream(file);
        int b;
        while((b = inputStream.read()) != -1){
            System.out.print(b);
        }
    }
}
